writer.writeAttribute("xsi:schemaLocation",
"http://www.garmin.com/xmlschemas/GpxExtensions/v3 "
"http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd");
-// "http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"
-// "xmlns:gpxx=\"" \
-// "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " \
-// "xsi:schemaLocation=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3 " \
-// "http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"
-// writer.writeEndElement();
#endif
if WAYPT_HAS(waypt, proximity) {
gbfprintf(ofd, "%*s<gpxx:Proximity>%.6f</gpxx:Proximity>\n", space * 2, "", waypt->proximity);
gbfprintf(ofd, "%*s</gpxx:Categories>\n", --space * 2, "");
}
if (*addr) {
- char* str, *tmp;
+ char* str;
#if OLDGPX
+ char* tmp;
gbfprintf(ofd, "%*s<gpxx:Address>\n", space++ * 2, "");
#else
writer.writeStartElement("gpxx:Address");
#if OLDGPX
tmp = xml_entitize(str);
gbfprintf(ofd, "%*s<gpxx:Country>%s</gpxx:Country>\n", space * 2, "", tmp);
+ xfree(tmp);
#else
writer.writeTextElement("gpxx:Country", str);
#endif
- xfree(tmp);
}
if ((str = GMSD_GET(postal_code, NULL))) {
#if OLDGPX
mmo_readstr(void)
{
char* res;
- int len;
+ unsigned int len;
len = (unsigned)gbfgetc(fin);
if (len == 0xFF) {
// length is number of "characters" not number of bytes
len = (unsigned)gbfgetc(fin);
if (len > 0) {
- int ii, jj, ch, resbytes=0;
+ unsigned int ii, jj, ch, resbytes=0;
res = (char *) xmalloc(len*2 + 1); // bigger to allow for utf-8 expansion
for (ii=0; ii<len; ii++) {
char utf8buf[8];
{
gbsize_t res;
- if (count > (int)bufsz) {
+ if (count > (unsigned int)bufsz) {
fatal(MYNAME ": Internal error (bufsz too small)!\n");
}
return res_OK;
}
-static int
+static unsigned int
rd_word(void)
{
int errors = 5; /* allow this many errors */
}
static int
-skytraq_rd_msg(const void *payload, int len)
+skytraq_rd_msg(const void *payload, unsigned int len)
{
int errors = 5; /* allow this many errors */
- int c, i, state;
- int rcv_len, calc_cs, rcv_cs;
+ unsigned int c, i, state;
+ unsigned int rcv_len, calc_cs, rcv_cs;
for (i = 0, state = 0; i < RETRIES && state < sizeof(MSG_START); i++) {
c = rd_char(&errors);
gbuint8 sectors_free[2];
gbuint8 sectors_total[2];
} MSG_LOG_STATUS_OUTPUT;
- int rc;
+ unsigned int rc;
if ((rc = skytraq_wr_msg_verify(&MSG_LOG_STATUS_CONTROL, 1)) != res_OK) { /* get memory status */
db(1, MYNAME ": Error sending LOG STATUS CONTROL message (%d)\n", rc);
{
gbuint8 MSG_LOG_SECTOR_READ_CONTROL[2] = { 0x1B, (gbuint8)(sector) };
int errors = 5; /* allow this many errors */
- int c, i, j, cs;
+ unsigned int c, i, j, cs;
gbuint8 buffer[16];
if (sector < 0 || sector > 0xFF) {
}
static int
-skytraq_read_multiple_sectors(int first_sector, int sector_count, gbuint8 *buf)
+skytraq_read_multiple_sectors(int first_sector, unsigned int sector_count, gbuint8 *buf)
{
gbuint8 MSG_LOG_READ_MULTI_SECTORS[5] = { 0x1D };
gbuint8 *buf_end_tag;
- int cs, i, read_result;
+ unsigned int cs, i, read_result;
if (first_sector < 0 || first_sector > 0xFFFF) {
fatal(MYNAME ": Invalid sector number (%i)\n", first_sector);
skytraq_set_location(void)
{
double lat, lng;
- int i;
+ unsigned int i;
gbuint8 MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
gbuint8 MSG_GET_LOCATION = 0x35;
#define NUMPOI (sizeof poinames/sizeof poinames[0])
int getPoiByName(char *name)
{
- int i;
+ unsigned int i;
for (i=0; i<NUMPOI; i++) {
if (strcmp(poinames[i], name) == 0) {
return i;
{
gbuint8 MSG_GET_POI[3] = { 0x4D, 0, 0};
gbuint8 buf[32];
- int poi;
+ unsigned int poi;
double lat, lng, alt;
double ecef_x, ecef_y, ecef_z;
waypoint *wpt;